package com.hao.wms.mvc;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Preparable;
import org.apache.struts2.ServletActionContext;

import java.io.IOException;

public class BaseAction extends ActionSupport implements Preparable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 96397973235137L;
	
	protected static final String LIST = "list";
	public static final String NOPERMISSION = "nopermission";
	protected static final String PAGERESULT = "result";
	
	protected void putContext(String key,Object value) {
		Object object = new Object();
		ActionContext.getContext().put(key, value);
		
	}
	protected void putSession(String key,Object value) {
		ActionContext.getContext().getSession().put(key, value);
	}
	protected void putResponseText(String data) throws IOException {
		ServletActionContext.getResponse().setContentType("text/html;charset=UTF-8");
		ServletActionContext.getResponse().getWriter().print(data);
	}
	@Override
	public void prepare() throws Exception {
		
	}

}
